<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" 
	xmlns:sec="http://www.thymeleaf.org/extras/spring-security">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    
    <!-- TopJUI框架样式 -->
    <link type="text/css" href="/topjui/themes/default/topjui.core.min.css" rel="stylesheet">
    <link type="text/css" href="/topjui/themes/default/topjui.blue.css" rel="stylesheet" id="dynamicTheme"/>
    <!-- FontAwesome字体图标 -->
    <link type="text/css" href="/static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <!-- layui框架样式 -->
    <link type="text/css" href="/static/plugins/layui/css/layui.css" rel="stylesheet"/>
    <!-- iconfont字体图标 -->
	<link type="text/css" href="/static/plugins/iconfont/iconfont.css" rel="stylesheet"/>
    
    <!-- jQuery相关引用 -->
    <script type="text/javascript" src="/static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="/static/plugins/jquery/jquery.cookie.js"></script>
    <!-- TopJUI框架配置 -->
    <script type="text/javascript" src="/static/public/js/topjui.config.js"></script>
    <!-- TopJUI框架核心-->
    <script type="text/javascript" src="/topjui/js/topjui.core.min.js"></script>
    <!-- TopJUI中文支持 -->
    <script type="text/javascript" src="/topjui/js/locale/topjui.lang.zh_CN.js"></script>
    <!-- layui框架js -->
    <script type="text/javascript" src="/static/plugins/layui/layui.js" charset="utf-8"></script>
	<!-- Ueditor编辑器插件 -->
	<script type="text/javascript" src="/static/plugins/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="/static/plugins/ueditor/ueditor.all.min.js"></script>
	
</head>

<body>
	<div sec:authorize="hasAuthority('system:content')" data-toggle="topjui-layout" data-options="fit:true">
		<div sec:authorize="hasAuthority('system:content:list')" data-options="region:'center',title:'',split:true,border:false,bodyCls:'border_right'">
			<table data-toggle="topjui-datagrid" data-options="
				id:'system-content-list',url:'/system/content/list',
				fitColumns:true,singleSelect:true,selectOnCheck:false,checkOnSelect:false,pageSize:50,
				childTab: [{id:'eastTabs'}]">
				<thead>
					<tr>
						<th data-options="field:'id',title:'ID',checkbox:true"></th>
						<th data-options="field:'title',title:'标题',width:200,formatter:openNewTab"></th>
						<th data-options="field:'keywords',title:'关键字',width:120,hidden:true"></th>
						<th data-options="field:'mainContent',title:'主体内容',width:100,hidden:true"></th>
						<th data-options="field:'remark',title:'备注',width:120,hidden:true"></th>
						<th data-options="field:'updateBy',title:'操作人',width:60"></th>
						<th data-options="field:'updateTime',title:'操作时间',width:120"></th>
					</tr>
				</thead>
			</table>
		</div>
		
		<div data-options="region:'east',iconCls:'icon-chart_pie',title:'',split:true,border:false,width:'50%'">
			<div data-toggle="topjui-tabs" data-options="id:'eastTabs',
				fit:true,
				border:true,
				bodyCls:'border_right_none',
				parentGrid:{
					type:'datagrid',
					id:'system-content-list',
					param:'id:id'
				}">
            <div title="内容详情" data-options="id:'eastTab0',iconCls:'fa fa-th',
				href:'/system/content/info/{id}'"></div>
			</div>
		</div>
	</div>
	
	<!-- 表格工具栏 -->
	<div sec:authorize="hasAuthority('system:content:list')" id="system-content-list-toolbar" class="topjui-toolbar" data-options="grid:{type:'datagrid', id:'system-content-list'}">
		<a sec:authorize="hasAuthority('system:content:add')" href="javascript:void(0)" data-toggle="topjui-menubutton" data-options="
			method:'openDialog',
			extend:'#system-content-list-toolbar',
			iconCls:'fa fa-plus',
			dialog:{
  				id:'system-content-add-dialog',
				title:'新增内容',
				href:'/system/content/add_view',
				width:'80%',
				height:'90%',
				buttonsGroup:[{
					text:'确定',
					url:'/system/content/add',
					iconCls:'fa fa-plus',
					handler:'ajaxForm',
					btnCls:'topjui-btn-green'
				}]
			}">新增</a>
		
		<a sec:authorize="hasAuthority('system:content:edit')" href="javascript:void(0)" data-toggle="topjui-menubutton" data-options="
			method:'openDialog',
			extend:'#system-content-list-toolbar',
			iconCls:'fa fa-pencil',
			dialog:{
				id:'system-content-edit-dialog',
				title:'编辑内容',
				href: '/system/content/edit_view/{id}',
				width:'80%',
				height:'90%',
				buttonsGroup:[{
					text:'确定',
					url:'/system/content/edit',
					iconCls:'fa fa-plus',
					handler:'ajaxForm',
					btnCls:'topjui-btn-green'
				}]
			}">编辑</a>
		
		<a sec:authorize="hasAuthority('system:content:delete')" href="javascript:void(0)" data-toggle="topjui-menubutton" data-options="
			method:'doAjax',
			extend:'#system-content-list-toolbar',
			iconCls:'fa fa-trash',
			confirmMsg:'确认删除已选择的数据？',
			grid: {uncheckedMsg:'请先勾选要删除的数据',param:'ids:id'},
			url:'/system/content/delete'">删除</a>
		
		<form sec:authorize="hasAuthority('system:content:query')" id="system-content-queryForm" class="search-box" style="float:right">
			<input type="text" name="name" data-toggle="topjui-textbox" data-options="id:'name',prompt:'名称',width:200">
			<a href="javascript:void(0)" data-toggle="topjui-menubutton" data-options="
				method:'query',
				extend:'#system-content-list-toolbar',
				iconCls:'fa fa-search',
				form:{id:'system-content-queryForm'},
				grid:{type:'datagrid','id':'system-content-list'}">查询</a>
		</form>
	</div>
	
	<script>
        function openNewTab(value, row, index) {
        	return '<a style="color:blue" href="javascript:window.parent.addParentTab({href:\'/system/content/info/' + row.id + '\',title:\'' + row.title + '\'})\">' + value + '</a>'
        }
    </script>
</body>
</html>